//
//  CountManagerView.m
//  FlowerRainGround
//
//  Created by lanou on 16/4/21.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "CountManagerView.h"

@implementation CountManagerView


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.view = [[UIView alloc] initWithFrame:CGRectMake(10, 10, kWidth - 20, 50)];
        self.view.backgroundColor = [UIColor whiteColor];
        self.view.layer.cornerRadius = 5;
        self.view.layer.borderWidth = 0.5;
        [self addSubview:self.view];
        
        //手机号
        self.phonenumberLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 80, 30)];
        self.phonenumberLabel.text = @"手机号";
        [self.view addSubview:self.phonenumberLabel];
        
        //显示手机号
        self.PhoneNumber = [[UILabel alloc] initWithFrame:CGRectMake(100, 10, 220, 30)];
        self.PhoneNumber.text = [userManager getUsrMobile];//获取用户手机号
    
        //截取字符串， 范围从下标为3开始，截取4个
        NSString *s = [self.PhoneNumber.text substringWithRange:NSMakeRange(3, 4)];
        //替换字符串
        self.PhoneNumber.text = [self.PhoneNumber.text stringByReplacingOccurrencesOfString:s withString:@"****"];
        [self.view addSubview:self.PhoneNumber];
        
        
        //发送修改密码的button
        self.changeNumberButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.changeNumberButton.frame = CGRectMake(self.view.bounds.size.width- 110, 10, 100, 30);
        [self.changeNumberButton setTitle:@"修改密码" forState:UIControlStateNormal];
        [self.changeNumberButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        
        self.changeNumberButton.backgroundColor = [UIColor orangeColor];
        [self.view addSubview:self.changeNumberButton];
        
    }
    return self;
}
















/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
